#!/bin/bash

# 第一 程序
echo "Stop gateway : gateway-1.0-SNAPSHOT.jar"
pid=`ps -ef |grep java|grep gateway-1.0-SNAPSHOT.jar | awk '{print $2}'`
echo 'old Procedure pid:'$pid
if [ -n "$pid" ]
then
kill -9 $pid
fi

# 第二 程序
echo "Stop user: user-1.0-SNAPSHOT.jar"
pid=`ps -ef |grep java|grep user-1.0-SNAPSHOT.jar | awk '{print $2}'`
echo 'old Procedure pid:'$pid
if [ -n "$pid" ]
then
kill -9 $pid
fi

# 第三 程序
echo "Stop goods: goods-1.0-SNAPSHOT.jar"
pid=`ps -ef |grep java|grep goods-1.0-SNAPSHOT.jar | awk '{print $2}'`
echo 'old Procedure pid:'$pid
if [ -n "$pid" ]
then
kill -9 $pid
fi

# 第四 程序
echo "Stop orders: orders-1.0-SNAPSHOT.jar"
pid=`ps -ef |grep java|grep orders-1.0-SNAPSHOT.jar | awk '{print $2}'`
echo 'old Procedure pid:'$pid
if [ -n "$pid" ]
then
kill -9 $pid
fi
